Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Misc] Define from_dict and to_dict in InputMetadata #3452

Merged
merged 7 commits into from
Mar 17, 2024
Merged

Conversation

WoosukKwon
Copy link
Collaborator

This PR adds from_dict and to_dict to InputMetadata so that the code in model runner becomes a bit cleaner.

@WoosukKwon WoosukKwon requested a review from zhuohan123 March 17, 2024 07:53
Copy link
Member

@zhuohan123 zhuohan123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This looks great!

@WoosukKwon
Copy link
Collaborator Author

@zhuohan123 Thanks for the quick review! 😄

@WoosukKwon WoosukKwon enabled auto-merge (squash) March 17, 2024 07:57
@youkaichao
Copy link
Member

Is it possible to use dataclass or something like that?

@youkaichao
Copy link
Member

I actually find transformers uses lots of dataclasses:

https://github.com/huggingface/transformers/blob/00c1d87a7d5c8dfb4554370983b5a3f7c069edd7/src/transformers/models/maskformer/modeling_maskformer_swin.py#L36-L67

And I think many configs in vLLM can also be dataclasses, too. We don't need to write these from_dict and to_dict, we also get nice str and repr implementation.

@zhuohan123 zhuohan123 disabled auto-merge March 17, 2024 08:06
@WoosukKwon
Copy link
Collaborator Author

@youkaichao Thanks for the suggestion! Merged your PR and fixed a bug.

@WoosukKwon WoosukKwon enabled auto-merge (squash) March 17, 2024 08:58
@WoosukKwon WoosukKwon disabled auto-merge March 17, 2024 09:10
@WoosukKwon WoosukKwon enabled auto-merge (squash) March 17, 2024 09:11
@WoosukKwon WoosukKwon merged commit abfc4f3 into main Mar 17, 2024
22 of 24 checks passed
@youkaichao youkaichao deleted the minor-cleanup branch March 17, 2024 16:53
Temirulan pushed a commit to Temirulan/vllm-whisper that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants